/*
 * util.h
 * 
 * This file includes some handy utiliy functions
 * 
 */

#ifndef UTIL_H_
#define UTIL_H_

#include <stdint.h>

#define PIN0 0x1
#define PIN1 0x2
#define PIN2 0x4
#define PIN3 0x8
#define PIN4 0x10
#define PIN5 0x20
#define PIN6 0x40
#define PIN7 0x80

#define CBIT(PORT, BIT)  (PORT) &= ~BIT
#define SBIT(PORT, BIT) ({CBIT((PORT), BIT); (PORT) |= BIT;})

// Prints a 16-bit integer over the UART as ASCII.  Delimited by a newline 
void print_int(int16_t val);

#endif /*UTIL_H_*/
